package com.sghd.charge.module.utils;

import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

/**
 * @author frank
 * @date 2019-02-23 10:25
 * @desc
 **/
@Component
public class Id {
    private IdWorker idWorker;

    @PostConstruct
    void init() {
        idWorker = new IdWorker(1);
    }

    public long nextId() throws Exception {
        return idWorker.nextId();
    }
}
